package main

import (
	"fmt"
	"regexp"
)

const text = `my computer is iMac, my mail cpp2088671660@outlook.com@asdasd
cpp@asdasd.com
asdasd is kkk@qq.com
`

func main() {
	//iMacRe := regexp.MustCompile("iMac")
	emailRe := regexp.MustCompile(`[a-zA-Z0-9]+@(.+\.[a-zA-Z0-9]+)`)
	emails := emailRe.FindAllString(text, -1)
	for _, email := range emails {
		allStringSubmatch := emailRe.FindAllStringSubmatch(email, -1)
		for _, elems := range allStringSubmatch {
			for _, elem := range elems {
				fmt.Println(elem)
			}
		}
	}

	//fmt.Println(emails)

	//compile.FindString(text)
}
